<template>
    <div>
        <form action="/">
            <van-search v-model="value" show-action placeholder="请输入搜索关键词" @search="onSearch" @cancel="onCancel" />
        </form>

    </div>
</template>

<script setup>
import { ref,watch } from 'vue';
import { qsearchApi } from '@/api/api';
const qsearchApiData=ref([])
let value;
const onSearch=()=>{
    watch(value,(val)=>{
    qsearchApi(val).then(res=>{
    console.log(res);
    qsearchApiData.value=res.data.message
})
})
}


</script>

<style lang="scss" scoped></style>